factor out logger