It's in the interest of the farmer to kill the animal swiftly because of what musajen said before.

Coming up with a cost-effective way of improvement of living conditions is more complicated due to the huge price difference between grain an grass fed. But that might change due to the advantage of local production due to their smaller environmental footprint.

In theory, as companies are held more accountable for their environmental and social performance (CAFO facilities have very big impacts), there could be a significant incentive to go more local and thus greener. Removing the subsidies for corn and other cereals would help enormously as well.