Change data structure from array to object.