refactoring the application structure