- Extracted listener startup logic into a separate method `_start_listeners` for better readability and maintainability.
- Created helper methods for SSL context creation.
- Improved session cleanup during shutdown by centralizing logic in `_cleanup_session`.
- Refactored message handling and subscription management into dedicated methods for clarity.
- Updated tests to reflect changes in method visibility for matching topics.
```
______________________________________________ ERROR collecting tests/test_utils.py _______________________________________________
tests/test_utils.py:3: in <module>
from hypothesis import provisional
<frozen importlib._bootstrap>:1176: in _find_and_load
???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:690: in _load_unlocked
???
../../../../.cache/pypoetry/virtualenvs/amqtt-4HWVaFGY-py3.11/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
exec(co, module.__dict__)
../../../../.cache/pypoetry/virtualenvs/amqtt-4HWVaFGY-py3.11/lib/python3.11/site-packages/hypothesis/provisional.py:37: in <module>
_comment, *_tlds = traversable.read_text(encoding="utf-8").splitlines()
/usr/lib/python3.11/importlib/resources/abc.py:83: in read_text
with self.open(encoding=encoding) as strm:
/usr/lib/python3.11/importlib/resources/_adapters.py:141: in open
raise FileNotFoundError("Can't open orphan path")
E FileNotFoundError: Can't open orphan path
======================================================== warnings summary =========================================================
../../../../.cache/pypoetry/virtualenvs/amqtt-4HWVaFGY-py3.11/lib/python3.11/site-packages/passlib/utils/__init__.py:854
/home/stuartl/.cache/pypoetry/virtualenvs/amqtt-4HWVaFGY-py3.11/lib/python3.11/site-packages/passlib/utils/__init__.py:854: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
from crypt import crypt as _crypt
-- Docs: https://docs.pytest.org/en/stable/warnings.html
===================================================== short test summary info =====================================================
ERROR tests/test_utils.py - FileNotFoundError: Can't open orphan path
```