We’ve all been there: totally fed up with a job, impatient with a demanding or incompetent boss, and ready to quit in a dramatic flash of pent-up frustration. The trouble is, leaving your job with fiery flair is going to burn a bridge, which you may need sooner than you think.

The smarter move is making sure you’re on solid ground with your old employer – even as you head off toward greener pastures. It’s all about quitting with class. Here’s how.

  1. Give as much notice as possible

If you’re sure you’re out the door, don’t leave your employer in the lurch by giving the bare minimum two-week notice if you can avoid it. It could take months to fill your job – if it’s even possible to fill your considerable shoes – so If you know you’re leaving in a month, why wait to issue notice?

  1. Compose a letter

Many employers require a formal letter of resignation anyway, but it’s worth viewing this as an opportunity rather than a burden. This is your chance to shape the message around your departure, and to clearly put into words your reason for leaving and your appreciation for the time you’ve had with the company. “Don’t use your letter to point to negatives, to settle gripes, or to say ‘I told you so,’” said David Maxfield, vice president of research with VitalSmarts and the author of four New York Times best-sellers. “Explain the positive reasons why you’re leaving.”

  1. Compose yourself

Before you submit your letter to your boss, evaluate your own emotional state. Are you still seething over being passed over for a promotion or stinging from a scathing performance review? If so, it’s not the time to talk. Storming into your boss’s office to quit is the fantasy of many an underappreciated worker, but it’s not a sound strategy. “The key is not to announce you’re leaving when you’re feeling high emotion,” said Janet Frood, leadership and team couch and founder of Horizon Leadership. “It’s really important to pause and get grounded so you can create good conditions for communicating effectively.”

  1. Excel in the exit interview

Striking the right balance between honesty and positivity in the exit interview can be tricky. Most experts stress the importance of giving constructive feedback, but there’s little sense in using this last face-to-face with your boss as an airing of grievances. “In today’s generation, being candid is valued. But talk about the circumstances behind your leaving, and don’t complain about the people you worked with,” said Gilles Rochefort, president of PMC Coaching.

  1. Be grateful

Even if you absolutely despised your job, it still provided an income and experience. As you look back, focus on what you learned, what you enjoyed, and what you’ll take with you from your experience, and thank those who helped you along the way. “Think of the way you’ve been able to improve life for your customers, the friends you’ve made on the job, the other things you enjoyed,” Maxfield said. “You want to be truthful but you want to be upbeat.”

  1. Smooth the transition

No one knows how to do your job like you, so be proactive in documenting all your job responsibilities, best practices, and workflow and offer to help training, on-boarding, or mentoring your successor.

  1. Don’t slack off

Sorry to break it to you, but the final few days of your employment are not a vacation. If anything, your employer might be eyeing your performance a little more closely than usual as you prepare to depart, and they will remember if you kept your foot on the gas or coasted aimlessly into the sunset. “At the end of your conversation with your boss, you’re still at work,” Maxfield said. “Make sure you end on a high note. Work hard until you’re gone. Because the ending is what people remember. How you act then is totally discretionary and therefore it shows your character, so be a class act.”

  1. Final farewells

Once you’ve packed your things and checked on all sorts of little details – your final pay cheque, your pension, returning any company property in your possession – be sure to bid your co-workers adieu without alienating them. “When you connect with your soon-to-be-former colleagues, be positive and don’t brag,” Maxfield said. After all, they still have to work there.