Use stack allocated classes, check return value of the start command and combine the rule creation function.