optimising the validation rules