parse beams and nodes