remove macro interface. use template instead.
fix memory leak bug.
add destructor.