a bit more cleanup of index code