move clear-acquisitions code out of template and into js file