Refactored the Shrimp middleware to act more like PDFKit's.