Restructured for API