Added switch for ZIP compression. Refactoring.