refactor routing