minor compression refactoring