Convert an object containing more objects into an array