JSON output / Rows Contain Key / Some refactoring