Improving code coverage using more testable json write class