Remove unneeded rules.