add group support, modify some other things