more cleanup logic