We try to use underscore templates for writing markup. If it's not too hard and too much, could you convert this to use underscore templates? Here's the documentation for it: http://documentcloud.github.io/underscore/#template.

Here's a SO example of it being used: http://stackoverflow.com/questions/4778881/how-to-use-underscore-js-as-a-template-engine/10389847#10389847.

We use it in a similar way. Here's a sample commit where I added a new underscore template: https://github.com/UWFlow/rmc/commit/8358be9c.

Search for `sign-in-modal-tpl` in the diff, and you should see the line `{% call macros.us_template('sign-in-modal-tpl') %}`. This is where the template is defined.

Then there's  the line `template: _.template($('#sign-in-modal-tpl').html())` where the template is parsed.

Finally, the template is used to generate an HTML string in the following lines:

 ```
this.template({
  title: this.title,
  message: this.message
})
```

This can be a little confusing if it's your first time using templates, so feel free to ask questions. Alternatively, add a TODO to convert this to use HTML templates.