js and templates