Refactoring, tests for some basic routes