more work on the router to allow more dynamic routing