More generator refactoring
Finish generator refactoring