DRY up validation a bit