updated doc, small refactor