formatting cleanup and API