Cleaned Up Widget code