cleaning code + solved bug of set_dir_utility not erasing file before writing data