I don’t think it matters much. Either way is probably fine. If you expect to use this validation in other places or if recomputing it is expensive then yea, sure, extract it.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.