move phone number validation to separate function