Code cleanup and more examples