Cleanup of code and examples