minor refactorings around transactions