Refactor app