Refactor transaction_repo