Clean up some obscurity in API code