added support for model caching