dependency injection for register method