private function cleanTarget(): void
    {
        foreach ($this->targetDictionary->keys() as $key) {
            if (!$this->sourceDictionary->has($key) || $this->sourceDictionary->get($key)->isSourceEmpty()) {
                $this->logger->log($this->logLevel, 'Removing obsolete {key}.', ['key' => $key]);
                if ($this->dryRun) {
                    continue;
                }

                $this->targetDictionary->remove($key);
            }
        }
    }