Improve and extend the routing API