Cleaning up routing and fixing a bug