Reorganise cacheImpl