refactor count sketch