Split the validation process into more functions