more cleanup in demo code