improve teardown