Dgroups refactoring