refactored version validation.

Just housekeeping.