Removed redundant code from the controllers.