Improve extracting of a fixed number of groups.