$this->levels renamed to $this->groups, better indentation