Moved routing logic to controllers.