clean up code for tests