Implements groups functionality