There's a lot going on in this class. Is it possible to break it up? Maybe into different classes that generate the header, the body, etc..