refactored code setup and teardown methods to address comments