Refactored the output of the pdf