Use generator in generator instead of generator in iterator