Cleanup and small refactoring

Remove some old routing code and do a small refactoring.