Remove unused code from controller