Issues: sorting is "random" figure out whats a "namespace" vs. "class" vs. "interface" put classes in correct namespaces Most of this could be fixed by a seperate sorting/regrouping step before generating the definition.