refactor to applyContentRules