add dependency injection

add dependency injection