Change Array.forEach and Array.indexOf to util.forEach and util.indexOf