Clean count() code