Validate the fields of the forms, structuring code