move file loading option to a separate function