javascript and templating updates