simplify unlink-wait
seperate metadata connection