Refactoring of upload method
Restored Python docstrings