Smooth and coherent layers of GaAs and AlAs grown by molecular beam epitaxy