Refactoring remove and edit action