you can make your code notably more efficient by storing clientGroup.getCount() into a variable, then referencing that variable
clientGroup.getCount() is extremely slow to execute, and while odds are no one will ever notice, it's always a good idea to think about how to make your code more efficient as you become a more proficient programmer.