Generally we want the electron to cross energy gaps in material A. Not in material-B because its just covering. And Eg in the A should not be very small otherwise there will be huge heat loss because of large difference in Eg and energy of incident photon