Refactoring with examples