Is there a clean way to move this out to a template? It is a little odd to be using both templates and literal markup.