refactoring code fot zip