Refactoring core rule merging computation.