Whole app refactor