moved templates to script tag