public function singleton($key, $value)
    {
        if (is_callable($value)) {
            $this->registerFactory($key, $value);
        } else {
            $this->sm->setService($key, $value);
        }
    }