Refactor of WidgetManager for scope management