Move zipping code into a generic function containing system-specific info