using __enter__ and __exit__ instead of _set_up and _clean_up