Moved format_message to widget.py