refactored hbs-template rendering