add del func, some optimization in macro