improved router to support the concept of sub-routers