Refactoring.
More code for transaction system.