Some refactoring
Initial group manager code