Merge "Factor out adding records to a generic"