Thermal treatment of the active layer