Updated the routing functionality