Update gen-doc script and documentation
Unify  implementations