public boolean logout() {
    if (isAuthorized) {
      LogoutMessage logoutMessage = new LogoutMessage(loggedInUser);
      sendMessageToServer(logoutMessage);
      isAuthorized = false;
      this.loggedInUser = null;
      return true;
    }
    return false;
  }