Cleaning up bits of index code