Doc update  + Refactoring  + doc test