Added factorization caching