WIP: refactoring defservice