Refactoring Counter into a separate module