improved clean up logic