Change routes and refactor tests