Removed redundant code from view