refactoring totals in pool_summary