Refactored classes and tests involved in prime factorization