reduced grounding of replaceCommonTerm
refactored some conditions common to several rules