templates.js in progress