Code refactoring: use widget.parts and save data to data-widget-data instead of child element.