optimizee the buffer appending process