rules cleanup