validation.py: Minor refactoring and docstring clarification.