Refactored pdfHelper into a service