Revamped the structure of node and graph classes