mild cleanup of routes code