Lots of clean up in index file