A pile of refactorings to thin out the router and fix other problems.