The above code snippet only run when user specify '--cleanup' which means he would like to erase both data and metadata after running.

The only change from the patch is to make it configurable that if user specify a meta-data object, the user specified one is used, or else the default one is used.