added dependency injection mechanism