better integration between routes and controller.  Also more general improvements