Using a better api to simplify the steps for delete partition