Hi Digital One,
Have you added User Groups in the organization and want to get list of users in the organization ? If yes, you can use the custom method you have mentioned i.e. to iterate through all UserGroups of the organization to get a list of user and remove duplication.
If you have added Users in the organization; you can simply use getmembers and other service to get the list of members.
I hope it helps.