Reduction of dislocations in GaAs and InP epitaxial layers by quasi ternary growth and its effect on device performance