groupings and fields selections refactor