clean up repeated demo code