app refactoring