Implemented better approach - access the type graph directly in the context.