Use factory for service definitions
Merge branch 'use-factory'