Refactored ResourceProvider, ResourceCache.