Refactor the Transaction abstraction and implementation