Restructure the header handling to allow full use of pre-rendered headers to avoid garbage creation.