A 30km run. An open-water swim through rough surf. An 80km ride with your cycling buddies. What all these feats have in common—other than requiring a gargantuan amount of effort—is that they seriously tax your immune system.

For example: Athletes who completed CrossFit-style workouts on consecutive days had suppressed immune systems, according to a small (and non-CrossFit-sanctioned) study published in Frontiers in Physiology. Moreover, a 2007 study published in Sports Medicine found that marathon-type exertion takes an even greater toll on your body: As you pound out the mileage and stress hormones rise, your skin, upper respiratory tract, blood, and muscle health start to decline, and your susceptibility to illness peaks.

But a new research review from Australia’s Queensland University of Technology suggests a simple solution that’ll have your body kicking into recovery mode faster than ever: carb up.

Why carbs? Researchers believe they can bolster your health and promote faster recovery from exercise because they stabilize blood sugar levels during particularly grueling workouts, which lowers your body’s stress response. So, in theory, carbs are able to prevent your immune cells from wandering off to other parts of your body in an effort to diffuse stress (say from your aching, burning lungs) and hopefully prevent illnesses and infections.

“Exercise is a form of stress, and more vigorous exercise creates more physiological stress, which causes physiological and biochemical changes in the body,” Jonathan Peake, a co-author of the Queensland study, said in a press release. “People often have fewer natural killer white blood cells after a workout [those “B and T” cells], but we now believe they move to other parts of the body, rather than being destroyed,” he adds. “To tackle the potential threats these changes highlight, the immune cells may simply move out of the blood stream to the lungs, for example.”

But there’s a catch: Those carbs only really make a difference in long-term workouts. While you can certainly work up a great sweat during shorter workouts, researchers say you only need carbs during high-intensity or prolonged exercise of 90 minutes or more.
“The consumption of carbohydrates before and during strenuous exercise not only improves endurance performance, but it can also minimize exercise-related immune disturbances,” co-study author Oliver Neubauer suggests.

You can also get your carbs in the first few hours after exercise to protect your health, he notes. “This is especially important in situations where the recovery duration between two consecutive exercise sessions is short, which is often the case for athletes.”