Use getType() instead of deprecated getTypeId()