Move common logic from BinaryTypeRuleDefinitionHandler and ComponentModelRuleDefinitionHandler into base class

+review REVIEW-5134