redone the templating system