Cleanup index script code.