Added cacheFactory, to cache the categories.