Small improvement to the rules generation