Refactor sending PDF files