improves test with setup and teardown