demo code cleanup