protected function executeRemoveDomain(InputInterface $input, OutputInterface $output) {

        // If no domains are left, exit
        if (empty($this->environment->domains)) {
            $output->writeln('<comment>There are no domains assigned to this environment!</comment>');
            exit;
        }

        // Ask for a domain
        if ($input->getArgument('domain') == NULL) {
            $helper = $this->getHelper('question');
            $domains = $this->environment->domains;
            $question = new ChoiceQuestion(
                'Which domain would you like to remove? ',
                $domains,
                null
            );
            $name = $helper->ask($input, $output, $question);
        }

        // Confirm removal.
        $helper = $this->getHelper('question');
        $question = new ConfirmationQuestion("Remove the domain <comment>$name</comment> from the environment <info>{$this->app->name}:{$this->environment->name}</info> [y/N]? ", FALSE);

        if (!$helper->ask($input, $output, $question)) {
            $output->writeln("<fg=red>Domain not removed.</>");
            $output->writeln('');
            exit;
        }

        // Find and remove the domain from the config.
        $key = array_search($name, $this->environment->domains);
        unset($this->environment->domains[$key]);

        // Save the new version to the config.
        $this->getApplication()->getTerra()->getConfig()->add('apps', array($this->app->name, 'environments', $this->environment->name), (array) $this->environment);
        $this->getApplication()->getTerra()->getConfig()->save();
        $output->writeln("<info>Domain removed.</info> Changes won't take effect until the environment is restarted.");
        $output->writeln('');
    }