Refactor routes, extract duplicated methods