Change parsing logic to handle more root objects