Improved code by removing redundant code

Also, now making sure that defaults are restored

Change-Id: I0326c256fec747685efbfabb8e71f5012fe9d0fe