A major overhaul of program interface, factorize filtering part in PatternGenerator