refactor app code"