Improved units grouping