Revert "Changes to the cache system of the factories"

This reverts commit 47801facba9e12bcc098309ba219c2d556f4e2b2.