initial refactoring to support upload from zip