Refactored validation.
A validator function is now used for both fields.
Merge branch 'first_iteration' into second_iteration