Moved the CacheInserter at top-level