refs #4 Add the private implementation for write metadata