generator and extractor