That morning cup of joe is keeping you young. New research from a team of Italian scientists shows that coffee drinkers have a lower risk of developing the sort of brain impairment that can lead to diseases like Alzheimer’s and dementia — but only if they drink in moderation.

Since there’s nothing researchers can really do to deal with cognitive decline — and its progression into full disease — these researchers want to focus on preventing it from happening in the first place. Our best bet so far? Coffee. As we all know, it’s the best (and probably safest) psychoactive stimulant we’ve got, and its ability to increase alertness and improve cognitive function could be crucial to keeping our aging brains from deteriorating.

Over an average of three and a half years, the researchers traced the coffee habits and cognitive decline of more than 1,400 people aged 65 to 84. They found that people who were moderate, regular coffee drinkers — one or two cups a day — had the lowest risk of cognitive decline. But moderation is key here: Those at high risk either didn’t drink any coffee or increased the number of cups they had per day over time.

Ditto goes for caffeinated tea. So, go ahead and pour yourself another cup — just don’t overdo it.

Photos via https://www.flickr.com/photos/ultrakml/