Move code from core to scratch buffer.