public function get($domain, $key = null)
    {
        $this->validateDomain($domain);

        if (null === $key) {
            return new Config($this->profile[$domain]);
        }

        if (!isset($this->profile[$domain][$key])) {
            throw new \InvalidArgumentException(sprintf(
                'Unknown key "%s" for profile domain "%s"',
                $key, $domain
            ));
        }

        return $this->profile[$domain][$key];
    }