Refactoring using routes