split route setup and custom middleware