The FBI first discovered Omar Mateen, the man who would kill 49 and injure more than 50 others at a gay nightclub, when he boasted of a friendship with terrorists.

Mateen told one of his co-workers at a private security firm in 2013 that he knew Boston Marathon bombers Tamerlan and Dzhokhar Tsarnaev. Mateen’s co-worker reported that information to the FBI.

Federal agents were already investigating Tamerlan Tsarnaev’s links to Ibragim Todashev, an Orlando man who was shot and killed during a scuffle with an FBI agent.

A link between the Boston Marathon bombers and another Florida man sounded plausible. Agents took the tip seriously and interviewed Mateen on two separate occasions.

Their conclusion: Mateen was spinning fantasies and wasn’t a threat. His file was closed.

If the investigating agents were required to close Mateen’s file, the reason wasn’t due to lack of legal authority. The bureau forces agents to close assessments because agents are pursuing thousands of assessments nationwide under a policy to pursue any and all leads, no matter how ridiculous they are.

The caseload can be overwhelming for FBI offices.

Jeff Danik, who recently retired after 29 years with the FBI, worked in the bureau’s counterterrorism section in South Florida. He didn’t investigate Mateen — but he knew the agents based in Fort Pierce who did.

“These guys do not let things get away from them in investigations,” Danik said. “They pushed it as hard as they could.”

The problem, Danik said, was the FBI’s bureaucracy. FBI brass want agents to show immediate results. “If you cannot come up with articulable facts in a short period of time, you’re required to shut these cases down,” Danik said.

The FBI later reopened its investigation of Mateen, because agents were concerned about his connections to Moner Mohammad Abu-Salha, whose alias was Abu Hurayra al-Amriki. Abu-Salha joined the Nusra Front and became the first American suicide bomber in Syria. Before his death, he recorded a video in which he burned his U.S. passport.

“I went back to my home state, which is Florida,” Abu-Salha said in the video. “I stayed with my friend’s family. And it was no good. The reason I had to stay with them is that the state I was in, I finally realized I was being watched.”

Abu-Salha said he knew he was under FBI surveillance in Florida, and he was. Federal agents began investigating everyone he made contact with, including Mateen. But agents concluded that Abu-Salha’s contact with Mateen was minimal and that Mateen was not a threat.

Mateen’s FBI file was closed again.

Two years later, Mateen legally purchased an assault rifle and a handgun, then opened fire on a crowded nightclub in Orlando.

Mateen’s transformation from not being a threat in the FBI’s view to carrying out the worst mass shooting in U.S. history can be attributed to what the FBI calls “quick flash to bang.”

“If the bureau had looked at someone for 60 or 90 days while they were a casual observer of the jihadi world, then they’re going to conclude this guy doesn’t have a big touch,” Danick, the former FBI agent, said. “Then two months later a triggering event.”

A “quick flash to bang” might never be detectable in the FBI’s view. But Danik cautions that he believes the FBI’s “quick flash to bang” theory also allows federal agents an easy out — a pass for failing to stop someone like Mateen. “It’s an excuse for agents,” Danik said. “Hey, quick flash to bang. That’s why we didn’t get him.”

Michael German, a former FBI undercover agent who is now a fellow with the Brennan Center for Justice’s Liberty and National Security Program, agreed that Mateen might have fallen through the cracks not because the FBI didn’t have the authority and resources to investigate him sufficiently, but because the bureau has a history of arbitrarily limiting agents.

“They’re imposing rules and restrictions that don’t actually exist [in the law],” German said. “There actually isn’t a time limit on assessments.”

Already, in the wake of the Orlando shooting, there are calls to provide the FBI with more resources and greater investigative powers. But neither is a problem for the FBI, in German’s view.

“I would simply suggest we take time to examine how the authorities and resources have already been used by the FBI,” he said. “Checking somebody’s work is the only way to make sure they’re doing it correctly.”

He also questioned the effectiveness of the bureau’s pursue-every-lead counterterrorism policy.

“There needs to be a reasonable threshold before they initiate investigations,” German said. “Right now, there really isn’t one.”

Correction: June 15, 2016
An earlier version of this story incorrectly referred to the assault weapon used in the Orlando shooting as an AR-57. In fact, initial reports was that it was an AR-15. Officials have since clarified that it was a Sig Sauer MCX.