refactor transaction.go