cql generator and spec hierarchy cleanup