Refactoring and routing