generator refactoring
implement GETC