Refactor the Compact class inside adapters.py (issue #13).