Refactoring in Application class