refactor for handlebars