simplify parser function and change terminology of 'parents' to 'ancestors'