More DiagramParser refactoring