Move the is_prime function to a separate module
Minor change