added mod_type and register_type.