Improve exit_json flow