Gertrude Stein once wrote that coffee “is much more than a drink; it is something that is happening.

The more experts study coffee, the more this “something” seems to be good for us.

Just this month, a large study in the journal PLOS Medicine found evidence that those who drink 1 to 3 cups of coffee a day have about a 14% lower risk of stroke and about the same reduced risk of dementia compared with those who drink 1 to 3 cups of coffee a day people who abstain.

As usual, moderate consumption was associated with the greatest benefit. When people drank four or more cups, their risk of stroke and dementia returned to baseline, the study found.

That same daily dose showed up again and again in the coffee survey, which at this point is solid and mostly positive. “The biggest benefits seem to be [with] about 3 to 5 cups a day,” says Walter Willett, MD, a professor of epidemiology and nutrition at the Harvard T.H. Chan School of Public Health.

Willett co-wrote a comprehensive review of the research on coffee and caffeine that appeared last year in the New England Journal of Medicine (NEJM). Like the new PLOS Medicine study, their review found that drinking coffee can reduce a drinker’s risk of several major diseases.

The list includes type 2 diabetes, neurological disorders, liver disease, heart disease, and cancers of the skin, breast, and prostate. Research has also linked coffee to improvements in mood and mental health.

“It is not clear at this time whether lighter or darker roasted coffee has more benefits.”

How can coffee do so much for us? Many of the health benefits can be attributed to caffeine.

Caffeine binds to receptors in the brain, specifically adenosine receptors, which help control the release of dopamine, epinephrine, serotonin, and other neurotransmitters. These hormones play a role in our sleep, appetite, energy, memory, and mood.

While many of the details are unclear, the effect that caffeine has on adenosine receptors and their related brain chemicals may provide a mechanistic explanation for some of the coffee’s apparent health benefits.

When it comes to the health effects of different styles of coffee, the research is spotty. “It’s not clear at this point whether lighter or darker roasted coffee has more benefits,” says van Dam.

But Willett offers a warning about French press coffee, Turkish coffee, and other brews that avoid filtration. These types contain high levels of a compound in coffee called cafestol, which can cause health problems. “Unfiltered coffee can raise blood cholesterol levels, so filtered coffee is the healthiest,” he says.

Finally, his and van Dam’s research review identified some broad safety limits regarding caffeine intake. About 400mg per day, or around 200mg per session, seems to be a safe upper limit.

The average 8-ounce cup of home-brewed coffee contains 92 mg of caffeine, but coffee shop coffee, which is typically brewed with a higher ratio of powder to water, may contain double that amount of caffeine, according to figures in their study.

It’s hard to believe now, but until recently coffee was considered a health threat. While you should still avoid heavily sweetened “coffee drinks,” all those spicy lattes and cappuccino perversions sold at the big coffee chains, a few old-school cups of joe seem like a healthy addition to your daily routine.