cleaned up code after migrating to handlebars