refactor and get ready for offline compressing

You are right