refactor app helper