renamed $typeOf => $type