Code cleanup
Cleanup and some example code