Use class constructor in Rule.gen