refactor countminsketch