Refactor repeated code in record type edit view response handler