Major Widget code cleanup