Seems to me that record_to_common_format is designed to do this already...