migrate []byte to alloc for better performance