Improve generation when file already exists