some better handling of files.