Added support for layer grouping