clean up code in index