Tidy up the demo code