Refactoring file transfer