use templating for html generation for widget