refactor app to move readable functions to router