refactor "closing" test