refactor perl/lib/LogCounter.pm