remove count() operation in writeVariants