Removed some redundant code from controller and views