def prep_file(url, dir)
        parts = url.split('/')
        File.join(dir, parts[-1])
      end
def prep_file(url, dir)
        parts = url.split('/')
        File.join(dir, parts[-1])
      end
Pure function to create correct filename