Refactored Application class