Some small refactoring on transactions.cpp