change global services to use dependency injection