Refactor: extract YAML/JSON parsing routine