Moved function factories to RuleFactory