While your reasoning is correct, your conclusion is not. Factory farming is wrong and should end. That probably will never happen but that doesn't mean we should all become vegan.
More humane ways of raising animals exist. They have existed since mes settled with the advent of agriculture. We should go back to eating locally, to supporting our local farms and farmers. Instead of having a daily big mac, have a nice steak bought from your local butcher once a week. If you have direct access to a cattle raising farm, get your meat from there. Know from where our food comes from, the less processed and more close to nature you eat the better. If you want to be vegan, or vegetarian, or ovo-vegetarian, or whatever other distinction are out there, good.
Avoiding all types of pain, suffering, and death we are becoming less human, not more.