Factor out counters and add rolling histogram