Remove duplicated code in putTxRecord