You're right, there are probably missing pieces. When adding items to jobNames it is safe to add them to allJobNames as well, when removing items it is probably safer to recompute it.