Refactoring file upload extension