improved html rendering for templates
code cleanup
added support for dailycred