major refactoring and passing add and remove tests