Separated the transaction_code calculation from the string repr function