cleaned up generator semantics