My solution to the prime exercises. Please help me in refactoring and writing proper specs

Thanks