Refactored FTP upload