Cleanup and sample code