cleanup in test and tool