Cleaned code, removed singletons