Refactoring around Primes