Minor refactoring of FileUpload