Tidy up some code on index page