Did refactoring; removed the redundant counter functions.

Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>