DiagramCreator code refactoring