Improving the graph directive, better encapsulation and scope isolation