Refactor, seperate pdf generation code. No longer storing generated pdfs since they can just be regenerated when need