first rewrite of new extractor