Counter.java refined