unit test code cleanup