restart effort toward templating. cleanup main.js