Refactor: extract execute-with-transaction