Remove duplicated patterns