refactor JSON object output