clean up the code so there is less duplication, added some more basic tests for add all / remove all