refactoring the App class