removing unused code from indexcontroller