refactor value from type to v8 type and value