45 - Moved file generation into generateFile()