refactoring min remove according to the api change