factor html dumping into tk-element