rafactored handlebars js