public function cleanKeys($data)
    {
        $pregMatches = (bool) preg_match(self::PREG_PROPERTIES, '?');
        $chars = '';
        $chars = $pregMatches ? '\pL' : 'a-zA-Z';


        if (!preg_match('#^['.$chars.'0-9:_.-]++$#uD', $data)) {
            throw new \Exception('Illegal key characters in global data');
        }

        return $data;
    }