Cleaning up to_json