pulling more logic out of the controller