Rework graph builder structure