Refactor Transaction and Dataset