fix Singleton Pattern (remove globals)