Refactor validate flows to reduce duplication.