Break up validation into smaller functions