simplifying the routing logic