regenerate the structure of the file