took out type_cast method replaced with class