Refactored writing to include entire request/response