Refactor parseCounters()