You are very misinformed. Katy is an awesome writer. Here is an article as she explains her thoughts when she wrote "By The Grace Of God" and others off of the "Prism" cd. Most of that cd is about her divorce from Russell Brand.
http://music-mix.ew.com/2013/10/22/katy-perry-divorce-russell-brand-prism/