new Generator, little refactoring