Refactoring router object.