Simplify group get values logic
Tidy up code