cleanup debug page code