now takes a logger instance rather than repeatedly asking for the logger