factory for transaction