factor old parsing; add YAML parsing