Separate the actual generation and serialization from the rule compilation