Pull templates and other functions out of branding bar.js