Separate Mako logic and JS logic