delete function, refactoring, save as fix