add compaction for rules