small refactoring of compress filter.

Signed-off-by: Chris Jones <chris@jonezy.org>