Add toNativeType() method