Handlebar templates and fixed memory issue