Refactor File Upload

Moved upload logic into model