clean up the test code with side effects