refactor app files