[refactoring] c++ code with using ObjectWrap