refactor redis counter