modelbuilder: split the class_not_found error in a separate function