moved decide_pattern_.. out of class