Changing shutdown mechanism and adding PdfGenerator