updated doc, refactor