Heavy refactor to use Transfer and TransferState from common.