While it's fairly common for television shows to occasionally craft an episode as a musical, and it's not exactly an easy thing. Writing music and staging special choreography takes a certain amount of extra work, which is why you rarely see a series go back to that well twice. It's Always Sunny In Philadelphia is breaking that tradition with its Season 12 premiere, however, and it's all thanks to a bit of inspiration received from Lin-Manuel Miranda and the hit Broadway play Hamilton.

I learned about the influence of the Tony-winning musical last summer when I had the pleasure of sitting down with Charlie Day and Rob McElhenney on the Los Angeles set of It's Always Sunny In Philadelphia while the show was in production of what would be its Season 12 premiere: The Wiz-inspired "The Gang Turns Black." Aware of the series' first musical episode (the Season 4 finale "The Nightman Cometh"), I asked if they had always planned to eventually go back to the genre. After explaining that they never expected to do it again, Day told me that it was actually meeting Lin-Manuel Miranda that really motivated him to start writing songs again. Said the actor,

I'd seen Hamilton on Broadway with my wife, and when Lin-Manuel was taking his bow, he looked at Mary Elizabeth and I, and thought, 'Holy shit, it's Charlie and the waitress!' So we went backstage and we went up to see him and he said, 'I was on stage trying to get The Nightman Cometh songs out of my head while trying to remember mine!' What he was doing was so inspiring, and it was so inspiring that he was a fan of Sunny that I just had an itch for writing some more music this season.

Seriously, can you blame him?

This motivation came at just the right time too, because it actually wound up saving the script that would wind up becoming the Season 12 premiere. Rob McElhenney told me that the original drafts of "The Gang Turns Black" didn't work as well as they were hoping, and that it was Charlie Day's desire to turn it into a musical that wound up making everything click. Said the It's Always Sunny In Philadelphia creator,

We didn't want to do it. We had an episode that wasn't quite working, wasn't really landing and then Charlie came in and said, 'Hey, I want to do another musical. I think we should make this one a musical.' And I was like, 'I don't want to do that. It's so much work.' And he's like, 'Let me lock myself in a room for three days.' He came out with six songs and I was like, 'Oh, let's do a musical!'

Charlie Day followed up by admitting that he had actually been toying with some of the music for a while, and that he was able to link episode-related lyrics to what he had been working on -- but that's still pretty damn impressive. There aren't a lot of people who could do what he did... but his incredibly creative talents go a long way in explaining "The Gang Turns Black" is an amazing episode and why It's Always Sunny In Philadelphia is one of the best comedies on television.

It's Always Sunny In Philadelphia has now begun its twelfth season, and new episodes air every Wednesday at 10pm on FXX. Hit the comments section to tell us what you thought about the season premiere, and stay tuned for more from our trip to the set!