Use pairmemcpy in more places