Refactor FileHelper method to getFileToWrite().