refactored get_stats so it will return a more robust object including some aggregation