again with the refactorings
refactoring
unit test for other operations
changes to make a sensible api