remove duplicate patterns