WASHINGTON (AP) — When President Barack Obama decided to attend a memorial service in Arizona for victims of a deadly mass shooting that severely injured then-Rep. Gabrielle Giffords, he needed a speech. And fast.
The service was in two days.
Jon Favreau, then chief White House speechwriter, was deep into writing Obama's 2011 State of the Union address, due in less than three weeks.
Up stepped his deputy, Cody Keenan. "I'll do whatever you need. Put me to work," Favreau recalled him saying.
Keenan met with the president to get some ideas, then started in. He stayed with it right through Obama's flight to Arizona, tweaking the speech even after landing.
The result was one of Obama's most well-received speeches, 34 minutes of impassioned prose in which he appealed for people to "talk with each other in a way that heals, not in a way that wounds."
The speech got Keenan some notice, too. On the return flight to Washington that night, he was publicly identified as the writer — not routine practice for the White House.
"It's C-O-D-Y K-E-E-N-A-N," then-press secretary Robert Gibbs told reporters.
Two years later, when Obama needed a new head speechwriter, he turned to Keenan, a 32-year-old fellow Chicagoan.
Favreau, who left in March after five years as the president's lead wordsmith and his campaign speechwriter before that, first brought Keenan into Obama's orbit as an unpaid summer intern on the presidential campaign in 2007.
Keenan was pursuing a master's degree in public policy at Harvard's Kennedy School of Government and was intent on returning to work in the Washington office of Sen. Edward M. Kennedy when a colleague from the Massachusetts Democrat's office steered him to Favreau.
"Cody's quiet at first, very unassuming, but he was so happy to be there and was such a hard worker, and I instantly recognized that he also had this amazing writing talent," Favreau said in an interview.
At summer's end, Keenan considered quitting school to stay on with the campaign but ultimately decided to complete his studies. He kept in touch with Favreau and even flew to Iowa during Christmas break to help with the leadoff presidential caucuses. Not long after earning his degree in the spring of 2008, he was hired by Favreau as a junior speechwriter.
"Ever since then, he's just been an integral part of the team," Favreau said.
Current and former White House colleagues, all Obama campaign veterans, praise Keenan's writing skills and work ethic and what they describe as his sense of fairness, modesty and willingness to help.
His speechwriting, they said, is guided by the emotion of the audience he's trying to reach. And, most important for any speechwriter, they said, Keenan knows his subject well.
"Cody's just like this toiling workhorse," said Alyssa Mastromonaco, a deputy White House chief of staff who worked with Keenan on Obama's campaign. "There's nobody who has a better attitude or that you want to be around more than Cody."
When Obama decides to give a major speech, the writing process starts weeks, sometimes months, ahead of time with "the download" — the president giving the writer ideas about what he'd like to say.
The White House likes to portray Obama, the author of three best-selling books, as very involved in the writing of his speeches. And on more important speeches, he is. Behind-the-scenes video released by the White House on the drafting of last year's State of the Union address includes close-ups of the text, with Obama's editing changes penned all over it in blue ink.
But any president has to have help.
Keenan, a deputy and about six others, including two who also write for Michelle Obama, produce everything from brief presidential statements on deaths and retirements to remarks congratulating sports teams for winning tournaments, scientists for their inventions and service members for bravery. They also turn out commencement, policy and other speeches.
The White House declined to make Keenan available for an interview. But in a recent Kennedy School interview, Keenan said the 24-hour media environment of cable TV, Twitter, blogs and other competing information sources have made the White House speechwriter's job more challenging.
"With rare exceptions, the bully pulpit doesn't reach as many people as it used to," he said. "Our job is to keep the president's message fresh and arguments compelling even as they've been the same for the past six years."
Keenan is said to have been deeply influenced by Kennedy, a fellow Irish-American, and by his two years at Harvard's Kennedy School, named for the late senator's assassinated brother, President John F. Kennedy.
He started in Kennedy's office in 2003 as an unpaid intern in the mailroom and soon was hired to answer front-desk phones.
Stephanie Cutter, who worked with Keenan in Kennedy's office, said the senator often asked how many people would be helped by a contemplated action. She said Keenan was inspired by Kennedy's desire to get results for constituents.
Coincidentally, one of the first speeches Keenan wrote for Obama was about a national service bill that Kennedy sponsored and Obama signed into law in April 2009. After learning of Keenan's role, Kennedy later sent him a congratulatory note that hangs framed on a Kennedy tribute wall in Keenan's office, said Ben Rhodes, a Keenan friend and now a deputy national security adviser.
After Kennedy's death that August, Keenan helped write the eulogy Obama delivered at the senator's funeral.
2011 Tucson, Ariz., memorial service remarks: http://1.usa.gov/fGjdTA
2012 State of the Union: http://1.usa.gov/zsxJYu