Refactored the application structure