Optimization of erbium-doped waveguide amplifier