Refactoring: collapsing JSON and YAML implementations together