Routes refactoring, other minor tweaks