refactoring and class diagramm