Clean up validation code