remove uncessary memcpy