remove comments and change as_json to to_json