Refactor app somewhat