refactor func, native and goblin