Perry wrote the song with her longtime collaborator, the Canadian producer Greg Wells, along with the Boston folk-rock singer-songwriter Jonatha Brooke. "That was so much fun," Brooke told Radio.com of her writing collaboration with Perry. "I had gotten word from friends over the years that she kept mentioning me in interviews as an influence and I thought, 'Well, that's wicked cool. How sweet is that?' I'm a huge Katy Perry fan. Finally a mutual friend at ASCAP hooked us up."
"We spent three days in the studio [and] that was the first song we wrote," Brooke continued. "I brought this kalimba, which is a tiny wooden thumb piano. I thought, 'I'm going to go meet Katy Perry, what can I bring that's a little unusual and would be fun for the session?'"
Brooke started jamming on the kalimba, which kicked off the writing session. "Greg heard the kalimba rhythmic thing and started building this really deep track around it and it just inspired all of us," she said. "It was like we were finishing each other's sentences in the room. When that happens you're pretty psyched. Once in a while it's like bad dating. Sometimes something happens and you're like, 'Oh God, when will this be over?' Luckily we were all inspired by each other."
"The song materialized and was pretty fun and immediate," she added. "I'm psyched my kalimba is still a very big part of the track."
"The main way it changed from our initial demo is that Katy added awesome unbelievable vocals, especially at the end," Brooke continued. "She started stacking vocals. I'm just a fan of that. That was very, very exciting. And that it made it on the record at all was cool."