refactoring for app design