public function getPreparseFieldsContent(Element $element, string $eventHandle)
    {
        $content = [];
        $fieldLayout = $element->getFieldLayout();

        if ($fieldLayout) {
            foreach ($fieldLayout->getFields() as $field) {
                if ($field && \get_class($field) === 'aelvan\preparsefield\fields\PreparseFieldType') {
                    /** @var PreparseFieldType $field */

                    // only get field content for the right event listener
                    $isBeforeSave = ($eventHandle === 'onBeforeSave');
                    $parseBeforeSave = (bool)$field->parseBeforeSave;

                    if ($isBeforeSave === $parseBeforeSave) {
                        $fieldValue = $this->parseField($field, $element);

                        if ($fieldValue !== null) {
                            $content[$field->handle] = $fieldValue;
                        }
                    }
                }
            }
        }

        return $content;
    }