By accurately optimizing the growth conditions for an oxygen doped AlN nucleation layer and for the subsequent epitaxial process the crystal quality of our GaN layers could be improved drastically. In X-ray diffraction analyses we observed FWHM values of 39 and 114arcsec for the symmetric (004)- and asymmetric (114)-reflection, respectively. Consequently, the nominally undoped samples showed semi-insulating behavior in Hall measurements. By in situ deposition of a SiN interlayer, the dislocation density could be reduced by more than a factor of 2, reaching a value of 4×108cm-2 as confirmed by transmission electron microscopy and etch pit density counting. Samples with this low dislocation density showed an extremely narrow X-ray FWHM of 71arcsec for the asymmetric (114)-reflection along with a narrow linewidth of 870μeV in photoluminescence (PL) for the donor bound exciton (D0X) at a temperature of 10K. Atomic force microscopy yielded a very low rms roughness value of about 0.14nm across a 4μm2 scan area. Finally the excellent crystal quality could be confirmed by growing AlGaN/AlN/GaN high electron mobility transistor structures with reverse breakdown voltages ⩾1000V and a very low sheet resistance of 330Ω/□.