It seems that Apple CEO Tim Cook is quite capable of getting angry without getting stupid, which is no small accomplishment. At a recent shareholder’s meeting, Cook was pressed by representatives of a conservative think tank, The National Center for Public Policy Research, about the impact of the company’s renewal energy policies on the bottom line. He was also asked to cease taking on projects that are not focused on profit alone.

Byron Chaffin, author of the Mac Observer, reports that Cook was clearly angered and defended Apple’s stance, saying, “When we work on making our devices accessible to the blind, I don’t consider the bloody ROI.” And, “If you want me to do things only for ROI reasons, you should get out of this stock."

Related: Dealing With Feelings: How to Be an Emotionally-Aware Leader

The problem for most people in an instance like that is not that they get angry -- it’s that they become less intelligent when they do. This happens because the energy required by anger is stolen from the ability to reason. If you have ever encountered a truly angry person, you know that there is no good trying to reason with them. They simply cannot think clearly while in that state. Cook, however, was able to use his anger as fuel to reaffirm Apple’s commitment to sustainability and other social issues.

Many practicing managers try to drive bad moods and negative emotions out of organizations. However, recent research suggests that we can leverage our “afflictive emotions” -- such as anger, greed, hate, guilt or longing -- to drive positive results.

Most of us operate on the principle that thinking would be better, clearer and more efficient if we kept our feelings out of it. However, as neuroscientists have been saying for years, and management scientists are now beginning to realize, our thinking is completely bound up with our feelings. In fact, rather than seeing ourselves as thinking machines that have feelings, it would be more accurate to say we are feeling machines that are capable of thought.

These two understandings -- that we can leverage afflictive emotions, and that thinking and feeling are bound together -- have important consequences for certain moments in which you might exercise leadership by leveraging an afflictive emotion, such as the one Cook found himself in. Consider anger as a fuel that you can use to generate the energy required to move to productive action.

Your goal should be to “respond,” rather than “react.” A reaction is a somewhat thoughtless and sudden event, usually involving saying or doing something that you will later regret. A response is when you exhibit the behaviors and actions you thoughtfully planned to demonstrate when and if you were ever in that situation. While we have no clear evidence that Cook anticipated the challenge he faced during his stockholder’s meeting, we would be willing to make a modest bet that he did.

The first step toward responding rather than reacting is to identify your “triggers” -- those kinds of people and situations that lead you to a highly-charged emotional state. Ask yourself right now: What type of behavior in others and what types of situations tend to make me feel upset?

After you have identified your personal triggers, you are equipped to do something about the anger that results. The key to developing your ability to remain intelligent, even as your blood begins to boil, is to recognize that anger is not a binary emotion. That is, you don’t have to be either angry or not. There are many levels of anger.

Related: Get Angry! Be Passionate! Your Emotions Are Vital to Success.

At the mildest, you are slightly irritated, and then you become frustrated. If the situation persists you become angry, and if the emotion continues to build, you may become enraged. To remain intelligent while angry, you must start small. You can do this by retaining your thinking ability when you are merely irritated, before the emotion escalates.

To avoid getting stupid when angry, ask yourself three questions before an interaction that you suspect might anger you:

  • How am I feeling right now?
  • Why I am feeling this way?
  • What emotions am I primed to experience?

Get really good at asking these questions. Do not let yourself off the hook with superficial answers such as “I just do.”

The next two questions will help you manage your emotions during the moment they occur:

  • Are my emotions intensifying?
  • Am I choosing to allow my emotions to heighten, or are they now in charge?

Be mindful of what is going on inside you in these moments. Practice this skill frequently so you can stay engaged in conversation while also monitoring your emotional reaction in real time.

These final questions will help you to redirect the emotion toward a positive end: What would be a good use of the energy I am feeling right now? What could my next step be?

The point is not to calm down, but to hold onto the high energy state that you are in when you are angry, recognize that it can be useful and direct it toward something productive.

Related: Why 'Don't Take It Personally' Is BS