optimized(less function calls) goto-based ArrayQuery class