clean up and merge