Add groups + optimize code.