Refactor remote operation to delete file and folder