decompose prime factors
optimize factorization