Refactoring of upload to new improved format