Refactor router._run and clean up server controller.