fix refactor error
improve go function