refactor: abstract method writeToDOTFile()