- refactor service layer
- backport some tests from scala-style