rewriting optgroup code to avoid hardcoding, moving configuration back
into datatypedef.xml