Added new transaction handling with tests