Refactor Counter impl