Change the custom validation code to use the easier way