internal usage of transaction()

closes #368. (right?)