Removing unused code
Adding check for view settings