`end unless template_parameters[:media_attributes].nil? is clearer