Refactor RuleStep in engine