Use early returns to reduce indentation.