Add some additional comments on validation.
Rename and reformat some validation related code.