improve the way local files are handled