refactor app management