Moved router logic to controllers.