Little restructuring to read the file