Further cleanups towards the API.