move sumamry munging logic to munge_summaries function