refactor MultipleNaive endIndex