public function cleanBacktrace(array $trace): array
    {
        // find first not removable index
        $firstNotRemovable = 0;
        foreach ($trace as $index => $item) {
            if (! $this->shouldRemoveStack($item)) {
                $firstNotRemovable = $index;
                break;
            }
        }

        $trace = array_slice($trace, $firstNotRemovable ?: 0);

        return $trace;
    }