Performance upgrade for finding index for item.