Add file transfer function
Clean code and variable name