Don't use "global" status_counts.
Move history_data to non-global thingy.