Better way to count primary file types