Simplify status code logic in controllers.