refactor in Transaction db