Refactor widget.