refactored to use handlebars