Transactions refactoring WIP