refactored file uploads