Minor code cleanup of the `diagrams` tool code and documentation