refactoring diagram 1