protected function mapData(array $data, array $options)
    {
        if (!isset($options['settings_field'])) {
            $field = $options['key_field'] ?? 'key';
            expect_type($field, 'string', \BadMethodCallException::class);

            unset($data[$field]);
        } else {
            $field = $options['settings_field'];

            if (!isset($data[$field]) && !(bool)($options['optional'] ?? false)) {
                throw new LoadException("DynamoDB item '{$options['key_value']}' doesn't have a '$field' field");
            }

            $data = $data[$field] ?? [];
        }

        return $data;
    }