Rework find_groups to accept arbitrary parameters