Better way of generating $infofile