public function set($domain, $key, $value = null)
    {
        $this->validateDomain($domain);
        if (null !== $value) {
            $this->profile[$domain][$key] = $value;
        } else {
            $this->profile[$domain] = $key;
        }
    }