Clean up routing code