split valid_visa process into a separate function