optimise the bad pattern match&change