Controlled Morphology In Bulk Heterojunction Polymer And Perovskite Solar Cells