It seems like a bad idea for a validation function to have side-effects.