examples and refactoring