write IID metadata more efficiently