Cleanup of the envelope format