Fleshed our the router code a bit.