Refactored hardcoding of index