implement def_class