refactor file sharing