index code cleanup