remove memcpy dependency