Refactor FileUpload.php