refactor , add doc