Refactorings to implement sequential download of script files