UNDO: remove memcpy/memset due to double-definition problem