Refactor to commands and tasks taking dependencies via constructor options. Pavign the way for dependency injection.