Cleanup and public api reduction.