Moved PDF-related code to PDFLoader class.