Refactored code to make the file name a gloabal variable