public static synchronized Simperium configureSimperium(final Context context, String token) {
    // Create a new instance of Simperium if it doesn't exist yet.
    // In any case, authorize the user.
    if (mSimperium == null) {
      mSimperium =
          Simperium.newClient(
              BuildConfig.SIMPERIUM_APP_NAME, BuildConfig.SIMPERIUM_APP_SECRET, context);

      try {
        mNotesBucket = mSimperium.bucket(new Note.Schema());
        mMetaBucket = mSimperium.bucket(META_BUCKET_NAME);

        mSimperium.setUserStatusChangeListener(
            new User.StatusChangeListener() {

              @Override
              public void onUserStatusChange(User.Status status) {
                switch (status) {
                  case AUTHORIZED:
                    startBuckets();
                    break;
                  case NOT_AUTHORIZED:
                    mNotesBucket.stop();
                    mMetaBucket.stop();
                    EventBus.getDefault().post(new NotificationEvents.SimperiumNotAuthorized());
                    break;
                  default:
                    AppLog.d(AppLog.T.SIMPERIUM, "User not authorized yet");
                    break;
                }
              }
            });

      } catch (BucketNameInvalid e) {
        AppLog.e(AppLog.T.SIMPERIUM, e.getMessage());
      }
    }

    authorizeUser(mSimperium, token);

    return mSimperium;
  }