update $folder + omit unnecessary code