Refactor sock HTML to have text in Mako template