Refactor parseYaml.