UPDATED small refactoring on gzipping.