Figuring out the timeline of comic book movies can be a tricky business, especially for the wide-ranging X-Men franchise, which spanned two sequels (X2: X-Men United and X-Men: The Last Stand), a prequel (X-Men: First Class) and a spin-off (X-Men Origins: Wolverine). Director James Mangold's The Wolverine is next in line, arriving in theaters this summer.

The filmmaker recently clarified where exactly this story takes place in the time line.

RELATED: Tom Hardy Joins the MCU's X-Men in '80s-Era Wolverine Fan-Art
"It's set after X-Men 3, but I wouldn't call it a sequel to X-Men 3. You have a choice the second you enter a world like this with a huge amount of comic books, backstories, three movies, a Wolverine origins movie ... You have decide where you're going to exist in relation to all these other things, particularly if you're working with an actor who actually played the character in other films."

The Wolverine is based on a 1982 comic book arc created by Chris Claremont and Frank Miller, which takes Hugh Jackman's Logan to Japan.

Here's what the filmmaker had to say, when asked why he was setting it in that time frame.

"Because of some of the themes in the Claremont/Miller saga. I felt it was really important to find Logan at a moment where he was stripped clean of his duties to the X-Men, his other allegiances, and even stripped clean of his own sense of purpose. I was fascinated with the idea of portraying Logan as a ronin - the definition of which is a samurai without a master, without a purpose. Kind of a soldier who is cut loose. War is over. What does he do? What does he face? What does he believe anymore? Who are his friends? What is his reason for being here anymore? I think those questions are especially interesting when you're dealing with a character who is essentially immortal."

When asked what exactly brings Logan to Japan, the filmmaker revealed that The Wolverine meets up with an old friend, while comparing the film to The Outlaw Josey Wales.

"An old friendship. What brings him there is an old ally in Japan. We find Logan in a moment of tremendous disillusionment. We find him estranged. One of the models I used working on the film was The Outlaw Josey Wales. You find Logan and his love is gone, his mentors are gone, many of his friends are gone, his own sense of purpose - what am I doing, why do I bother - and his exhaustion is high. He has lived a long time, and he's tired. He's tired of the pain. What I wrote on the back of the script when I first read it was 'Everyone I love will die.' The story I've been telling, he enters it believing that. Therefore he's living in a kind of isolation. He gets drawn to Japan by an old friendship and then finds himself in a labyrinth of deceit, caught up in the agendas of mobsters, of wealth, and other powers we come to understand."