Martin said he was listening to Perry when he was writing the album, explaining that her songs have a repetitive chord pattern with a sing-along melody over top. He stole that idea and used to for the track. He also got help from Avicii, who would inject it with the EDM feel he wanted — giving the whole song the sense of unity he saw at EDM shows.
“Every time I sing it, I’m like, yep, that’s how I want to live my life,” Martin said.
Watch the clip above. It’s actually pretty cool to see who the whole song came together.
source