moved groups management in separate file