upgraded handlebars
cleanup logic