refactored the prime rules into the strategy pattern