Refactoring in request and upload