refactor extractor