Refactor a few generators.