Router wholly rewritten