Improve subgroups filtering