Removed getIndex dependency