I free ranged my hens before the raccoon attacks happened but my last flock just got into the habit of pecking even free ranged and in a large barn. I wish i had gotten rid of the hen who started the pecking right off.
Having a large area is ideal and pens that give them space, still the pecking order prevails. Most counties in California now allow hens in the back yard, usually up to 4 hens, no roos, and the yards most people have in California subdivisions are sadly pretty limited in space. Space is very helpful, especially if you can separate the peckers from the "nice" hens.
Personally i have no problems with chickens wandering in neighborhoods, i had roos from time to time and they didn't bother me either, i like the sounds of birds and animals rather than sirens and cars.