Refactor the transfer stuff