Use generators in feature extractor