moving transaction-related stuff to its own file