patterns refactoring (part 3/3)