some memory transfer optimizations