Use records instead of maps when encoding new values in merge