Code refactoring around UploadActivity