add small metadata-writing utility