improved pause/resume and started to refactor uploading logic