final protected function loop(callable $counter, callable $retriever, callable $modifier, callable $persister, $label = null, $limit = 200, $skipStart = 0)
    {
        $count = $total = (int) $counter() - $skipStart;
        $modified = $index = 0;
        $steps = ceil($total / $limit);

        if (0 >= $total) {
            $this->writeln(sprintf('<error>Nothing to process for %s!</error>', $label));
            return;
        }

        $bar = $this->getProgressBar($total, $label);

        $this->writeln('', true, true);
        $bar->start();

        while ($count > 0) {
            $skip = $limit * $index + $skipStart;
            $items = $retriever($limit, $skip);
            $formatted = [];
            foreach ($items as $item) {
                $item = $modifier($item);
                if (null !== $item) {
                    $formatted[] = $item;
                }
            }
            $persister($formatted);
            $modified += count($formatted);
            $index++;
            $count -= $limit;
            $bar->setMessage($modified, 'modified');
            $bar->setProgress($total - $count);
        }

        $bar->finish();

        $this->writeln('', true, true);
    }