Refactor to use handlebars