restructured a bit to make the logger more generic