more consistent memset/memcpy usage