simplified the deletionfolders ifs