Whole app refactoring