refactoring updateCounters