Layout::__filterFamilies(): clean up duplicated code