split out app-totals update into its own method
factor out ES sum_up_app code