private static function registerSingleton(Slim $app, Recaptcha $recaptcha = null)
    {
        if (is_null($recaptcha)) {
            $config = $app->config('recaptcha');
            $recaptcha = new Recaptcha($config['secret'], $config['siteKey']);
        }

        $app->container->singleton('recaptcha', function () use ($recaptcha) {
            return $recaptcha;
        });

        return $recaptcha;
    }