router refactored