Clean up text_formatter code with a byte.Buffer