refactor transfer implementation