Refactored unzip code to improve performance.