doc
add example
refactoring