Implemented model loading and caching.