syntax_tree: Refactored graphical code