Use transaction_atomic instead of safe_*; add useful method