Clean widget code