accept code ref for content_type attribute