Some lines of pattern_detector base class.