replace __class__ with built-in function type()