this looks like something that should be in generator core. // @SBoudrias