Refactor to handlebars