Added solution for dependency injection