Restructure the widget to support CoreWidget