Clean up the examples to use the new API.