Closing out Friday’s BookExpo was a star-studded panel featuring actor and author Neil Patrick Harris, Daniel Handler (Lemony Snicket), and Chris Harris. The three panelists share a series of very fortunate creative connections. On the screen front: Neil Patrick Harris plays Count Olaf in the Netflix adaptation of Handler’s A Series of Unfortunate Events, which premiered in January. Also, Chris Harris was the executive producer and writer for the TV series How I Met Your Mother, which starred Neil Patrick Harris as one of the main characters, Barney Stinson.

On the children’s book front, all three authors have new books coming out from Little, Brown this fall. Neil Patrick Harris is making his middle grade debut with The Magic Misfits, due in November, while Chris Harris’s debut poetry book, I’m Just No Good at Rhyming: And Other Nonsense for Mischievous Kids and Immature Grown-Ups, illustrated by Lane Smith, pubs in September. Handler’s picture book The Bad Mood and the Stick, illustrated by Matthew Forsythe, releases in October. The three multi-talented panelists had a far-ranging discussion about humor, magic, and the element of surprise when writing for kids, among other topics.

Handler and Harris began by talking about the process of translating A Series of Unfortunate Events to screen and how Harris has gone about effectively embodying the character of Count Olaf. “My hat goes off to him [Neil],” said Handler. Before Harris was cast as the lead antagonist in the story, Handler had seen one of his musical performances: “He was making fun of a villain but also being scary,” he recalled, which was a clear sign that he would understand the intricacies of Count Olaf’s malevolence. Harris commented on how playing Olaf has been “the hardest work I’ve ever done as an actor.” After all, as Count Olaf, he actually plays many different characters and has to act under multiple layers of costume. Also adding a level of complexity to the character is the way in which the story is “playing to more than one audience,” and functioning on “multiple humor levels.” In other words, the comedy needs to speak to both kids and adults. For Handler, the importance of a children’s book that appeals to adult sensibilities is underestimated. After all, “books for children are being read out loud to children,” he said.

In writing his novel The Magic Misfits, Harris took some cues from Handler, setting out to create a story that has layers of meaning, that “warrants rereading,” and is “complex enough to be exciting.” Having practiced magic tricks since he was a kid, writing about young magicians for his middle grade debut came about rather organically. The story is not about a magical world, per se. Instead, it’s concerned with the aspect of learning and performing magic tricks: “I lose interest in worlds where magic is real,” he said. He likes the purity of “practical magic” as a distinctive form of performance and sleight of hand, he said. When he was a child, he spent a lot of time at the library because it was a great resource for discovering new magic tricks. Even for kids growing up today as digital natives, learning to be a skilled magician takes time and focus. “You must study it and seek it out. You have to be the detective, Encyclopedia Brown-style,” Harris said. He added that the book actually includes magic tricks themselves, “adjacent to other content” in the story.

Speaking of the library, Handler is nostalgic for the “magic of browsing” among the stacks, where readers have endless opportunity for the serendipitous discovery of a perfect book. “That may be the difference between the internet and the library,” he said. He added that magic and writing go hand in hand: “Literature is both a trick and magical,” he said, particularly from a child’s perspective. He added that the way words and sentences all come together to tell a story is “magical, fragile, and fluid.”

Something else that magic and storytelling have in common: the element of surprise. Neil Patrick Harris observed that in I’m Just No Good at Rhyming: And Other Nonsense for Mischievous Kids and Immature Grown-Ups, the language often surprises readers by subverting expectations. Handler agreed, saying that, in a highly positive sense, “the language is so startling.”

Surprising readers is also in Handler’s bag of tricks. “There’s a myth that children’s books provide structure and comfort [to readers],” he said. But actually, “the most successful stories acknowledge how bewildering the world is.” The Bad Mood and the Stick explores the frequently bewildering nature of children’s moods. It’s also about what it would be like to give a bad mood away to someone else, which Handler figured “is kind of delightful.”

In closing, the panelists touched on whether they write with their own children in mind and how the experience of reading might be different now than it was when they were kids themselves. Harris’s idea for I’m Just No Good at Rhyming initially came about through reading to and interacting with his kids. Handler’s 14-year-old son, meanwhile, is just now starting to read A Series of Unfortunate Events. He had always been too afraid to read it based on the description that Handler would give him of the plot, he said. Harris’s children aren’t reading yet, but there’s plenty of time—The Magic Misfits is the first of a series and Harris hasn’t shown all of his cards yet.