design the rule class