Refactored validation.
A validator function is now used for both fields.