code cleanup and usage cleanup

I'll update the sample to new version tomorrow.