update transfer logic and remove env method. env is not a good design