use more File.delete and File.join