changes to setup and teardown to facilitate testing