Revising validation code