added groups support
groups more flexible