All of the stuff you added to `PDFDocument` directly should be a mixin in a separate file, the same way vector graphics, fonts, etc. are. To do this, you make a separate file in the `mixins/` directory that exports an object of functions to be added to the `PDFDocument` class. Then, in `PDFDocument` call the [mixin](https://github.com/devongovett/pdfkit/blob/master/lib/document.coffee#L76) helper to load it. And if you need to do any initialization, do so in the constructor by [calling your initialization method](https://github.com/devongovett/pdfkit/blob/master/lib/document.coffee#L43).