Now uses a simpler factorization for small numbers