Main transfer logic