Split routing logic into separate Router module.