Update typeOf method