refactor rendering widget.