DGM-23 Better logging and dependency injection.