refactoring / apply Dependency injection