Variables grouping and removing from groups