handling groups with 0 servers too

also minor code improvements