Some generator refactorings