optimize array index retriever for xtemplate