more tests & using writebatch & fix clean root