fix refactor bug and namespace