public LoginResult genLoad() {
    try {
      if (type.equals(FACEBOOK)) {
        return loginViaFacebook();
      } else if (type.equals(TEST)) {
        return loginViaTestUsers();
      } else {
        throw new RuntimeException("Unknown type.");
      }
    } catch (Exception exception) {
      LoginResult result = new LoginResult(null, null);
      result.setError(ErrorType.UKNOWN_ERROR);
      exception.printStackTrace();
      return result;
    }
  }