move loading of JS and CSS to template