Replace several arrays by one array of records