Understanding singleton objects and statics