refactor hyperloglog