Refactor TrxGenerator into smaller classes.