refactor app further