refactoring dialog delete file