Better as functions that take the model as an arg and return an html string. Or better done on the server using the existing templates...?