Removed unnecessary code from widget