Use len directly in switch