refactoring for testing

removed ctors and singletons for better testability