optimize batchmesh
merge
optimize some function