refactoring of app