Clean up sample code a little