Generator refactored
Refactoring