refactoring diagram 2