Cleaned up the code and make the logger more usable outside of muffin.