public function setConfiguration($configuration, $configure = true)
    {
        if (!$configuration instanceof ConfigurationInterface) {
            $configuration = new Configuration($configuration);
        }

        unset($this->configuration); // destroy the old one

        $this->configuration = $configuration;

        if ($configure) {
            $this->configure();
        }
    }