use extractor for pattern matching