write an ugly 'def_class'