Women and millennial men were two key audience segments responsible for the summer’s most successful films, according to a new study released by marketing data analytics firm Movio.

Although the summer season overall was one of the worst in recent history — a 14.6% drop in domestic grosses from last summer — the study focused on the summer films that performed the best, rather than those that flopped. There were, after all, several major successes, including “Wonder Woman,” Christopher Nolan’s smash hit “Dunkirk,” and comedy breakout “Girls Trip.”

The Movio research examined those who go to the movies fewer than four times a year (deemed “infrequent moviegoers”) who typically make up about 14% of a movie’s audience. Many of the summer’s most successful films, it found, pulled in a larger percentage. For example, the audience for “Girls Trip” — which grossed $115 million domestic off a relatively low budget — was 25% infrequent moviegoers.

More specifically, the study found that many of the films that performed well appealed to infrequent female moviegoers. Women typically make up 15% of all infrequent moviegoers, but for “Wonder Woman,” “Girls Trip,” and “Dunkirk,” they represented about a quarter of the group.

“I think in a lot of ways women were the unsung heroes of the box office, at least for the successful films this year,” said Movio Cinema’s global president Matthew Liebmann. “I think that’s the hidden potential of the box office.”

The study also examined how the male millennial demographic powered several of the summer’s highest-grossing titles. The group typically makes up 14% of the average movie audience, according to Movio, but for “Spider-Man: Homecoming,” they represented 25% of the total audience.

While the films highlighted by the study were lucrative, flops including “King Arthur: Legend of the Sword” and “Rough Night” raise questions about why some films succeed while others misfire. Liebmann pointed out that “Wonder Woman,” “Girls Trip,” and “Dunkirk” were all successful among infrequent female moviegoers, despite representing three very different genres of film.

“I think each film probably has its own anecdote for why [it was successful], as opposed to an overarching reason,” Liebmann said, “which is probably why you can’t manufacture the next generation solely by formula.”

See graphics from the Movio study below: