refactoring App as a singleton