refactoring + add examples of use