add_pgid() and remove_pgid() are not great names for something that's doing ref counting. :/