add support for arbitrary nested groups, to support style inheritance