Separate the toString and toDOT methods.