Some cleanup and sample code