Generalize routers and rename Router to TreeRouter