refactored extractor