Refactored to use handlebars templates