Refactoring of app