refactoring of examples