Updated the Factory to use a better caching mechanism