Refactor the Application Class