optimize is Array check