Refactoring duplicate code i.e. create virtual file from zip entry