removed unused code from the controller