Further cleanup of the demo code