first refactoring
wip
wip
much cleaner api, adds some nice tests
Merge branch 'refactor-service'