Move helper methods from PatternExecutor to the ExtractionPattern model.