refactor and get ready for offline compressing

What about extending from `dict` as you are simulating it?