clean up the aggregate script