private boolean doProcess(GroupInstanceTerminatingEvent event, Applications applications) {

    // Validate event against the existing applications
    Application application = applications.getApplication(event.getAppId());
    if (application == null) {
      if (log.isWarnEnabled()) {
        log.warn(String.format("Application does not exist: [service] %s", event.getAppId()));
      }
      return false;
    }
    Group group = application.getGroupRecursively(event.getGroupId());

    if (group == null) {
      if (log.isWarnEnabled()) {
        log.warn(
            String.format(
                "Group not exists in service: [AppId] %s [groupId] %s",
                event.getAppId(), event.getGroupId()));
        return false;
      }
    } else {
      // Apply changes to the applications
      GroupInstance context = group.getInstanceContexts(event.getInstanceId());
      if (context == null) {
        if (log.isWarnEnabled()) {
          log.warn(
              String.format(
                  "Group Instance not exists in Group: [AppId] %s [groupId] %s "
                      + "[instanceId] %s",
                  event.getAppId(), event.getGroupId(), event.getInstanceId()));
          return false;
        }
      }
      // Apply changes to the topology
      GroupStatus status = GroupStatus.Terminating;
      if (!context.isStateTransitionValid(status)) {
        log.error("Invalid State Transition from " + context.getStatus() + " to " + status);
        return false;
      }
      context.setStatus(status);
    }

    // Notify event listeners
    notifyEventListeners(event);
    return true;
  }