Modernizing the file handling

See title