refactor: pull out logging stuff
Replace hack with standard lib function
refactor: remove small Utils