Refactor routes.