applied rest_counter's function grouping style to gen_counter.erl