remove rules with unused heads