use dependency injection for scan command