implement a branch visitor, now I need a way to isolate scopes.