refactoring the app object