Simplified getIndex()