extracted common Handlebars template compile and render into a service
function