Cleaning up some code in routing layer.