Refactor service model and tests