Two decades ago, working as a drill instructor in 1989, I learned two valuable lessons in leadership that have stuck with me to this day. They both centre around the fact that people, as a broad generalization, are lazy. On hearing that, you may think "but I'm not lazy!", but the sad reality is that most people are, very much so, and the few that aren't are constantly victimized by the majority others if they allow themselves to be.
Lesson number one: if you shout at a group of people, nothing changes. The problem with non-specific criticism is it allows each individual present to convince themselves you're talking about someone else. Yes, the rare not-lazy, more self-aware ones may worry you're talking about them and take action, but in all likeliness, they're not the ones who were the problem in the first place. If you have thirty cadets marching along, and three-quarters of them are not swinging their arms properly, shouting at the group to swing their arms will not make them do so. Rather, the quarter who were doing it adequately will do it slightly more.
If you want results with a group, be prepared to name names.
Lesson number two: given two options of how to do things, people will pick the easier of the two. If you want them to do something properly, doing it properly has to be the easier of the two. They will happily and consistently pick the incorrect way, even if it means occassionally being berated for it, if that way is easier. Cadets would walk half way from the mess to the parade square, get yelled at by the crossing guard for not marching properly, march until out of earshot, and then resume walking. They would do this daily. They did this until crossing guards started insisting they turn around, march back to the starting point, and do the whole thing over again. This changed the parameters of their decision. Instead of the options a) march, or b) walk and get yelled at, where b) is obviously the easier answer, they now had a) march, or b) walk, get yelled at, march back, and then do a) anyway. Suddenly marching from the beginning was the easier, lazier option.
If you want people to be good, make being bad require more energy.