And that is the legal standard anyway. A judge is too enforce as much as possible of the original contract, even if it is found to be illegal. Judges are encouraged to make the minimum possible adjustments to make the contract legal.
This makes what seems to be common practice today, signing contracts you think to be illegal because they "can't be enforced" lunacy.