Ported code for transaction view model