specs and slight refactoring for better transaction support