Work on the pdf refactor