get rid of memcpy