removing redundant matching patternas