collapsed the custom field handling into the common pattern