Cleanup and moving code sample to examples