move `isprime` function to separate module