Move factorization into a shared euler module.